Type StringMap

	Field smap:StringNode[]
	
	Method New()
	
		
	
	End Method

	Method Set(k:String,v:String)
		Local msize:Int = smap.length

		For Local i:Int = 0 To msize-1
		
			If smap[i].key = k Then 
				smap[i].value = v
				Return
			EndIf
		
		Next
	
		
		smap = smap[..msize+1]
		
		smap[msize] = StringNode.FromData(k,v)
	
	End Method
	
	Method Add(k:String,v:String)
	
		Local msize:Int = smap.length
		DebugLog "Mapsize: "+msize
		If msize > 0 Then
			For Local i:Int = 0 To msize-1
			
				If smap[i].key = k Then 
					smap[i].value = v
					Return
				EndIf
			
			Next
	
		EndIf
		smap = smap[..msize+1]
		
		smap[msize] = StringNode.FromData(k,v)
	
	End Method
	
	Method Contains:Byte(k:String)
		If smap.length <= 0 Then Return False
		
		For Local i:Int = 0 To smap.length-1
		
			If smap[i].key = k Then Return True
		
		Next
		Return False
		
	End Method
	
	Method Get:String(k:String)
		If smap.length <= 0 Then Return ""
		
		For Local i:Int = 0 To smap.length-1
		
			If smap[i].key = k Then Return smap[i].value
		
		Next	
	End Method
	

End Type

Type StringNode

	Field key:String
	Field value:String
	

	Function FromData:StringNode(k:String="",v:String="")
		Local s:StringNode = New StringNode
		s.key = k
		s.value = v
		Return s
	End Function

End Type
